//
//  AITwoViewController.m
//  ai2
//
//  Created by 杜超男 on 2019/3/19.
//  Copyright © 2019年 杜超男. All rights reserved.
//

#import "AITwoViewController.h"
#import "TwoManagementCenterViewController.h"
#import "ClassLanguageViewController.h"
#import "FaceViewController.h"
#import "XLSlideSwitch.h"//滑动滚动第三方
#import "Masonry.h"
@interface AITwoViewController ()<XLSlideSwitchDelegate>
@property (nonatomic , strong)XLSlideSwitch *ScrollView;///滚动视图

@end

@implementation AITwoViewController
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = YES;
    self.tabBarController.tabBar.hidden = NO;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    //RGBA(98/255.0, 187/255.0, 81/255.0, 1)
    self.view.backgroundColor = [UIColor colorWithRed:98/255.0 green:187/255.0 blue:81/255.0 alpha:1];
    NSArray *TitlesArr = @[@"管理中心" , @"表情筛选推送" , @"班级语言汇总"];
    NSArray *ControllersArr = @[@"TwoManagementCenterViewController" , @"FaceViewController" , @"ClassLanguageViewController"];
    NSMutableArray *ViewControllers = [[NSMutableArray alloc] init];
    for (int i = 0 ; i < TitlesArr.count; i ++) {
        //字符串创建控制器
        UIViewController *VC = [[NSClassFromString(ControllersArr[i])alloc] init];
        [ViewControllers addObject:VC];
    }
    //滚动视图
    _ScrollView = [[XLSlideSwitch alloc] initWithFrame:CGRectMake(0, 89+46, self.view.bounds.size.width, self.view.bounds.size.height - 86 - 40 - 90) Titles:TitlesArr viewControllers:ViewControllers];
    _ScrollView.delegate = self;
    _ScrollView.itemNormalColor = [UIColor whiteColor];
    _ScrollView.itemSelectedColor =[UIColor whiteColor];
    _ScrollView.customTitleSpacing = 30;
    [_ScrollView showInViewController:self];
    _ScrollView.layer.cornerRadius = 10;
    _ScrollView.layer.masksToBounds = YES;
    [_ScrollView mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.size.height.mas_equalTo(self.view.frame.size.height-160);
        make.top.mas_equalTo(self.view.mas_safeAreaLayoutGuideTop).inset(90);
    }];
    // Do any additional setup after loading the view.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
